{% load adminmedia %}

<tr>
    <!-- Fileselect for FileBrowseField -->
    {% ifequal query.pop 'pop=1' %}
    <td style="border-left: none !important; padding-top: 5px !important;">
        <a href="javascript://" onclick="FileSubmit('{{ file.link }}', '{{ file.path_thumb }}');" class="fb_selectlink"></a>
    </td>
    {% endifequal %}
    <!-- Fileselect for RTE/TinyMCE -->
    {% ifequal query.pop 'pop=2' %}
    <td style="border-left: none !important; padding-top: 5px !important;">
        {% ifnotequal file.file_type 'Folder' %}
        <a href="javascript://" onclick="FileSubmit('{{ file.link }}');" class="fb_selectlink"></a>
        {% endifnotequal %}
    </td>
    {% endifequal %}
    <!-- FileIcon -->
    <td style="border-left: none !important;"><img src="/media/filebrowser/img/filebrowser_{{ file.file_type }}.gif" style="margin-top: 1px;" /></td>
    <!-- Thumb -->
    {% ifnotequal counter.Image 0 %}
    {% if results_var.change_total %}
    <td style="padding: 4px; border-left: collapse;">
        {% if file.flag_makethumb %}
        <a href="makethumb/{{ file.filename }}/?{{ query.pop }}">
        <img src="/media/filebrowser/img/filebrowser_Thumb.gif" width="{{ thumbnail_size.0 }}" style="margin: 2px;" /></a>
        {% else %}
        {% ifequal file.file_type 'Image' %}
        <a href="{{ file.link }}"><img src="{{ file.path_thumb }}" height="{{ file.thumb_dimensions.1 }}" style="margin: 2px;" /></a>
        {% endifequal %}
        {% endif %}
    </td>
    {% endif %}
    {% endifnotequal %}
    <!-- Filename/Dimensions -->
    {% ifequal file.file_type 'Folder' %}
    <td style="padding-top: 8px;"><b><a href="{{ file.link }}/{{ query.query_str_total }}">{{ file.filename }}</a></b></td>
    {% else %}
    <td style="padding-top: 8px;"><b><a href="{{ file.link }}">{{ file.filename }}</a></b>{% if file.image_dimensions %}<br /><span class="tiny">{{ file.image_dimensions.0 }} x {{ file.image_dimensions.1 }} px</span>{% endif %}</td>
    {% endifequal %}
    <!-- Size -->
    <td style="padding-top: 8px;">{{ file.filesize_str }}</td>
    <!-- Date -->
    <td style="padding-top: 8px;">{{ file.date }}</td>
    <!-- Rename -->
    <td><a href="rename/{{ file.filename }}/?{{ query.pop }}" class="fb_renamelink"></a></td>
    <!-- Change Image / EXPERIMENTAL and not fully implemented -->
    {% if not query.pop %}
    {% if settings_var.USE_SNIPSHOT or settings_var.USE_PICNIK %}
    {% if results_var.change_total %}
    {% ifequal file.file_type 'Image' %}
    {% if settings_var.USE_SNIPSHOT %}
    <td><a href='http://services.snipshot.com/?snipshot_input={{ file.link }}&snipshot_output_options={"filename":"{{file.filename}}","filetype":"{{file.file_extension|cut:"."}}"}&snipshot_callback={{ settings_var.CALLBACK_URL }}snipshot_callback/&snipshot_output=file&snipshot_callback_agent=snipshot' class="fb_change"></a></td>
    {% endif %}
    {% if settings_var.USE_PICNIK %}
    <td><a href="http://www.picnik.com/service?_apikey={{ settings_var.PICNIK_KEY }}&_imageid={{ file.filename }}&_replace=ask&_import={{ file.link }}&_export={{ settings_var.CALLBACK_URL }}picnik_callback/" class="fb_change"></a>
    </td>
    {% endif %}
    {% endifequal %}
    {% ifnotequal file.file_type 'Image' %}
    <td>&nbsp;</td>
    {% endifnotequal %}
    {% endif %}
    {% endif %}
    {% endif %}
    <!-- Delete -->
    {% if results_var.delete_total %}
    <td>
        {% ifnotequal file.file_type 'Folder' %}
        <a href="delete/{{ query.query_str_total }}&filename={{ file.filename }}&type={{ file.file_type }}" class="fb_deletelink" onclick="return confirm('Are you sure you want to delete this file?');"></a>
        {% else %}
        {% if file.flag_deletedir %}
        <a href="delete/{{ query.query_str_total }}&filename={{ file.filename }}&type={{ file.file_type }}" class="fb_deletelink" onclick="return confirm('Are you sure you want to delete this file?');"></a>
        {% endif %}
        {% endifnotequal %}
    </td>
    {% endif %}
</tr>
 
